package com.xbongbong.pro.knowledge.base.pojo.dto;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.ConditionsEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.ExcelPartialExportPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 获取知识列表参数
 *
 * @author ruansicheng
 */
@Getter
@Setter
@ToString
public class KnowledgeListDTO extends BaseDTO {

    private static final long serialVersionUID = -7754566875888323466L;

    private Long menuId;

    /**
     * 分页当前页
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @Min(value = 1, message = "{dto.msg.formDataList.page.Min}")
    private Integer page;

    /**
     * 分页每页记录数
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @Min(value = 1, message = "{dto.msg.formDataList.page.Min}")
    private Integer pageSize;

    /**
     * 搜索条件
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<ConditionsEntityExt> conditions = new ArrayList<>();

    /**
     * 排序字段{"field":"updateTime","sort":"acs"}
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Map<String, String> sortMap;

    private Integer del;

    /**
     * 分组id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long listGroupId;

    /**
     * 知识库ID
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long knowledgeBaseId;

    /**
     * 目录id
     */
    private Long catalogueId;

    /**
     * 状态
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer status;

    /**
     * 标签ID
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<Long> tags;

    /**
     * 是否默认分组 2 公海分组 1 系统分组 0是自定义分组
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer defaultGroup;
    /**
     * saas标记
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @NotNull(message = "{dto.msg.formDataList.saasMark.NotNull}")
    private Integer saasMark;
    /**
     * saas业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    @NotNull(message = "{dto.msg.formDataList.businessType.NotNull}")
    private Integer businessType;
    /**
     * saas子业务类型
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer subBusinessType;

    @Getter(onMethod_ = {@QueryIgnore})
    private Map<String, FieldAttrEntity> explainMap;

    /**
     * 前端模糊搜索参数
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String nameLike;

    /**
     * 审批状态
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<Integer> flowStatusIn;

    /**
     * saas列表数据状态
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer statusFilter;

    /**
     * 特殊列表筛选
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private JSONObject commonFilter;

    /**
     * 导出为1
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer fromExport;
    /**
     * 部分导出
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private ExcelPartialExportPojo excelPartialExportPojo;
    /**
     * 勾选导出
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private List<Long> idIn;

    /**
     * 导出使用 ，上次查询的最后一条数据，用于确认下次查询的起始位置
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Object[] searchAfterList;
}
